var t = getApp();

Component({
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        }
    },
    data: {
        emptyImage: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png",
        clientWidth: "375",
        integral: "积分",
        clickTag: !1,
        show: !0,
        signdata: {}
    },
    lifetimes: {
        attached: function() {},
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {
        this.data.datas.params ? this.setData({
            show: !0,
            signdata: this.data.datas.params
        }) : this.setData({
            show: !1
        });
        var t = wx.getStorageSync("integral");
        t && this.setData({
            integral: t
        });
    },
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        signnow: function() {
            var a = this;
            if (!this.data.clickTag) {
                this.setData({
                    clickTag: !0
                });
                var e = t.getNetAddresss("plugin.sign.Frontend.Modules.Sign.Controllers.sign.sign");
                t._postNetWork({
                    url: e,
                    success: function(t) {
                        var e = t.data;
                        1 == e.result ? a.getNum(e.msg) : (wx.showToast({
                            icon: "none",
                            title: e.msg,
                            duration: 1500
                        }), setTimeout(function() {
                            a.setData({
                                clickTag: !1
                            });
                        }, 1e3));
                    },
                    fail: function(t) {
                        console.log(t.msg);
                    }
                });
            }
        },
        getNum: function(a) {
            var e = this, n = t.getNetAddresss("plugin.decorate.frotend.decorate-api.get-sign");
            t._postNetWork({
                url: n,
                success: function(t) {
                    var n = t.data;
                    1 == n.result ? (e.setData({
                        signdata: n.data,
                        clickTag: !1
                    }), wx.showToast({
                        title: a,
                        icon: "none",
                        duration: 1500
                    })) : (wx.showToast({
                        icon: "none",
                        title: n.msg,
                        duration: 1500
                    }), setTimeout(function() {
                        e.setData({
                            clickTag: !1
                        });
                    }, 1e3));
                },
                fail: function(t) {
                    console.log(t.msg);
                }
            });
        }
    }
});